package site.lanmushan.framework.query.entity;


import java.util.List;

/**
 * @Author dy
 * @Date 2020/7/3 20:39
 * @Version 1.0
 */
public interface TreeNode<T extends TreeNode<?>> {

    /**
     * @return
     */
    public boolean isRoot();

    /**
     * 添加子节点
     *
     * @param treeNode
     */
    public void addChildren(TreeNode<T> treeNode);

    public List<T> getChildren();

    /**
     * 判断是否为子节点
     *
     * @param child
     * @return
     */
    public boolean isChildren(TreeNode<T> child);


    default boolean hasChildren() {
        return false;
    }

    /**
     * 设置子节点
     *
     * @param children
     */
    void setChildren(List children);

}
